<?php

namespace App\Admin\Actions\Post;

use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class PlatformBalanceLogDayDetail extends RowAction
{
    public $name = '详情';

    public function href()
    {
        $day = DB::table('platform_balance_day_log')->where('id', $this->getKey())->value('day');
        $start = $day." 00:00:00";
        $end = date("Y-m-d 00:00:00", strtotime($start)+3600*24);
        return "/admin/platform-balance-logs?created_at[start]={$start}&created_at[end]={$end}";
    }

}